{include file="public/head" /}
{include file="public/js_ueditor" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{:lang('v_global')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_global')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_field')} {:lang('v_manage')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{empty name="rs.id"}{:lang('v_add')}{else /}{:lang('v_edit')}{/empty} {:lang('v_field')}</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="w-100 pt-3 pb-2 bg-white rounded mb-3">
                            <form name="form_keyword" action="{:url('/field/index',['lang'=>$lang])}" method="post" class="row">
                                <input type="hidden" name="lang" value="{$lang}">
                                <div class="col-md-8">
                                    <a class="btn btn-default mb-2 mr-2" href="{:url('/field/index',['lang'=>$lang])}"><i class="fa fa-list-alt"></i> {:lang('v_field')} {:lang('v_manage')}</a>
                                    <a class="btn mb-2 mr-2 {if input('fieldtype') eq 'text'}btn-success{else /}btn-default{/if}" href="{:url('/field/edit',['lang'=>$lang,'fieldtype'=>'text'])}"><i class="fa fa-plus-circle"></i> {:lang('v_add')} {:lang('v_method_text')} {:lang('v_field')}</a>
                                    <a class="btn mb-2 mr-2 {if input('fieldtype') eq 'textarea'}btn-success{else /}btn-default{/if}" href="{:url('/field/edit',['lang'=>$lang,'fieldtype'=>'textarea'])}"><i class="fa fa-plus-circle"></i> {:lang('v_add')} {:lang('v_method_textarea')} {:lang('v_field')}</a>
                                    <a class="btn mb-2 mr-2 {if input('fieldtype') eq 'thumb'}btn-success{else /}btn-default{/if}" href="{:url('/field/edit',['lang'=>$lang,'fieldtype'=>'thumb'])}"><i class="fa fa-plus-circle"></i> {:lang('v_add')} {:lang('v_img')} {:lang('v_field')}</a>
                                    <a class="btn mb-2 mr-2 {if input('fieldtype') eq 'file'}btn-success{else /}btn-default{/if}" href="{:url('/field/edit',['lang'=>$lang,'fieldtype'=>'file'])}"><i class="fa fa-plus-circle"></i> {:lang('v_add')} {:lang('v_file')} {:lang('v_field')}</a>
                                    <a class="btn mb-2 mr-2 {if input('fieldtype') eq 'richtext'}btn-success{else /}btn-default{/if}" href="{:url('/field/edit',['lang'=>$lang,'fieldtype'=>'richtext'])}"><i class="fa fa-plus-circle"></i> {:lang('v_add')} {:lang('v_editor')} {:lang('v_field')}</a>
                                </div>
                                <div class="col-md-4">
                                    <div class="input-group">
                                        <input name="keyword" placeholder="{:lang('v_quickfind')}" type="text" class="form-control">
                                        <span class="input-group-append">
                                            <button type="submit" class="btn btn-success"><i class="fa fa-search mr-1"></i>{:lang('v_search')}</button>
                                        </span>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="card card-outline card-success">
                            <div class="card-header"><i class="fas fa-edit mr-1"></i>{empty name="rs.id"}{:lang('v_add')}{else /}{:lang('v_edit')}{/empty} {:lang('v_field')}</div>
                            <div class="card-body">
                                <form name="form_edit" id="form_edit" method="post" action="{:url('/field/edit',['lang'=>$lang])}">
                                    <input type="hidden" name="id" value="{$rs.id}">
                                    <input type="hidden" name="lang" value="{$lang}">
                                    <input type="hidden" name="fieldtype" value="{if empty(input('fieldtype'))}{$rs.fieldtype}{else /}{:input('fieldtype')}{/if}" />
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right text-danger">{:lang('v_field')} {:lang('v_label')} *</div>
                                        <div class="col-md-6">
                                            <input type="text" class="form-control" name="fieldlabel" value="{$rs.fieldlabel}" {if !empty($rs['id'])}{if in_array($rs.id,explode(',',config('app.no_delete_fieldid')))}readonly="yes"{/if}{/if} placeholder="{:lang('v_english_only')}" />
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_field')} {:lang('v_description')}</div>
                                        <div class="col-md-6">
                                            <input type="text" class="form-control" name="fieldtext" value="{$rs.fieldtext}" />
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_field')} {:lang('v_content_a')}</div>
                                        <div class="col-md-{if input('fieldtype') neq 'richtext'}6{else /}9{/if}">
                                            {switch fieldtype}
                                                {case value="text"}<input name="fieldvalue" type="text" class="form-control" value="{$rs.fieldvalue}">{/case}
                                                {case value="thumb"}
                                                    <div class="input-group">
                                                        <input value="{$rs.fieldvalue}" name="fieldvalue" id="morepics1" type="text" class="form-control">
                                                        <span class="input-group-append">
                                                            <button onclick="upImage('#morepics1');" type="button" class="btn btn-success"><i class="fas fa-cloud-upload-alt mr-1"></i>{:lang('v_upload_img')}</button>
                                                        </span>
                                                    </div>
                                                {/case}
                                                {case value="file"}
                                                    <div class="input-group">
                                                        <input value="{$rs.fieldvalue}" name="fieldvalue" id="file" type="text" class="form-control">
                                                        <span class="input-group-append">
                                                            <button onclick="upFiles('#file');" type="button" class="btn btn-success"><i class="fas fa-cloud-upload-alt mr-1"></i>{:lang('v_upload_file')}</button>
                                                        </span>
                                                    </div>
                                                {/case}
                                                {case value="richtext"}<textarea name="fieldvalue" id="content1a" style="width:100%; height:300px;">{$rs.fieldvalue}</textarea>{/case}
                                                {case value="textarea"}<textarea name="fieldvalue" class="form-control" rows="5">{$rs.fieldvalue}</textarea>{/case}
                                                {default /}<input name="fieldvalue" type="text" class="form-control" value="{$rs.fieldvalue}">
                                            {/switch}
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_sequence')}</div>
                                        <div class="col-md-6">
                                            <input type="text" class="form-control checkstock" name="sequence" value="{empty name="rs.sequence"}0{else /}{$rs.sequence}{/empty}" />
                                        </div>
                                    </div>
                                    {include file="public/js_edit_area" /}
                                    <div class="offset-md-3 col-md-9 mb-4">
                                        {if is_file(app()->getRootPath().'.env')}
                                            <button type="submit" class="btn btn-success mr-4"><i class="fa fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                        {else /}
                                            <button type="button" class="do_ajax btn btn-success mr-4" onclick="javascript:do_ajax('#form_edit','.do_ajax','{:url('/field/edit',['lang'=>$lang])}','{:url('/field/index',['lang'=>$lang])}');"><i class="fas fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                        {/if}
                                        <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);"><i class="fa fa-angle-double-left mr-1"></i>{:lang('v_goback')}</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
<script type="text/plain" id="input_editor" style="display:none;"></script>
{include file="public/js_upload_file" /}
{include file="public/js_upload_img" /}
{if input('fieldtype') eq 'richtext'}
    {include file="public/js_rich_text_small" /}
{/if}
</body>
</html>